/*
 * @Author: anxia.ack anchenkai@come-future.com
 * @Date: 2025-05-07 21:15:24
 * @LastEditors: anxia.ack anchenkai@come-future.com
 * @LastEditTime: 2025-05-07 21:37:08
 * @FilePath: /free-learning-front/src/api/consultantReviec.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
const BASE_URL = "/api/v1/consultant/review";
import request, { post, put } from "@/utils/request";
import type { CourseReviewPageQuery } from "./review";

export interface ConsultantReview {
  id: number;
  userId: number;
  consultantId: number;
  consultantName: string;
  rating: number;
  comment: string;
  reviewTime: string;
  nickName: string;
  avatar: string;
  status: number;
  auditInfo: string;
}

export const getConsultantReviewPage = (
  courseReviewPageQuery: Partial<CourseReviewPageQuery>
): Promise<PageResult<ConsultantReview[]>> => {
  return request.post(BASE_URL + "/page", courseReviewPageQuery);
};

export const addConsultantReview = (
  consultantReview: Partial<ConsultantReview>
): Promise<boolean> => {
  return request.post(BASE_URL + "/add", consultantReview);
};

export const deleteConsultantReview = (id: number): Promise<boolean> => {
  return request.delete(BASE_URL + "/delete/" + id);
};

export const updateConsultantReview = (
  consultantReview: ConsultantReview
): Promise<boolean> => {
  return request.put(BASE_URL + "/update", consultantReview);
};


